import * as actionType from './constants'
import {reqdetail} from '@/api'

export const changeDetailData=(data)=>{
    return {
        type:actionType.CHANGE_DETAIL_DATA,
        data
    }
}

export const getDetailData =(id)=>{
    return (dispatch)=>{
        reqdetail(id)
            .then(res=>{
                dispatch(changeDetailData(res.data.data))
            })
    }
}